<template>
  <div class="container">
    <div class="recommend-title">热销推荐</div>
    <ul>
      <router-link tag="li" v-for="item of recommendList" :key="item.id" :to="'/detail/' + item.id">
        <div class="item-container">
          <div class="image-ready">
            <img :src="item.imgUrl"/>
          </div>
          <div class="item-info">
            <div class="title">{{ item.title }}</div>
            <div>{{ item.desc }}</div>
            <div class="price-container">
              <span class="mpg-price">¥</span>
              <span class="price">{{ item.price }}</span>
              <span class="wei-price">起</span>
            </div>
          </div>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    recommendList: Array
  }
}
</script>

<style lang="stylus" scoped>
.container {
  padding-bottom: .2rem;
}

.item-container {
  padding-top: 0.2rem;
  display: flex;
  flex-direction: row;
}

.recommend-title {
  line-height: 0.8rem;
  background: #eee;
  text-indent: 0.2rem;
}

.image-ready {
  width: 2rem;
  height: 2rem;
}

.image-ready img {
  width: 100%;
  height: 100%;
}

.item-info {
  padding-left: 0.22rem;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  height: 2rem;
}

.title {
  height: 0.44rem;
  color: #212121;
  font-size: 0.32rem;
  line-height: 0.44rem;
}

.price-container {
  display: flex;
  align-items: baseline;
}

.mpg-price {
  color: #ff8300;
  font-size: 0.24rem;
  line-height: 0.4rem;
}

.price {
  font-size: 0.4rem;
  font-style: normal;
  color: #ff8300;
  line-height: 0.4rem;
}

.wei-price {
  color: #616161;
  font-size: 0.24rem;
  line-height: 0.4rem;
}
</style>
